﻿/* floodfill.h
 * 
 * Copyright (C) 2020, 2021 Yuan LI
 * email:18069211@qq.com
 * https://blog.csdn.net/liyuanbhu
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or (at
 * your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */


#ifndef FLOODFILL_H
#define FLOODFILL_H

#include <QImage>

/**
 * @brief floodFill 漫水填充算法。
 * @param image
 * @param seedPoint 起始点。
 * @param newVal 填充的颜色。
 * @return
 */
bool floodFill(QImage &image, QPoint seedPoint, uint32_t newVal );

bool floodFill_Gray(QImage &image, QPoint seedPoint, uchar newVal );
bool floodFill_Gray(QImage &image, QPoint seedPoint, uchar low, uchar high, uchar newVal );
bool floodFill_RGB32(QImage &image, QPoint seedPoint, uint32_t newVal );
bool floodFill_RGB24(QImage &image, QPoint seedPoint, uint32_t newVal );

#endif // FLOODFILL_H
